#pragma once

#include "Frame.hpp"
#include "Text.hpp"




class ENGINE_UI_API LineEdit : public Frame
{
private:

	TextPtr   m_caption;

public:

	/**
	 * Create a LineEdit Widget.
	 */
	LineEdit(Widget* parent, Widgets::Type finalType = Widgets::LineEdit);

	/**
	 * Destroy this LineEdit Widget.
	 */
	virtual ~LineEdit();


	/**
	 * Get the description of the font.
	 */
	const FontDesc& fontDesc() const;

	/**
	 * Get the current text of this Widget.
	 */
	QString caption() const;

	/**
	 * Set the current text of this Widget.
	 */
	void setCaption(const QString& text);

protected:

	/**
	 * Get the type of this widget.
	 */
	virtual Widgets::Type type() const;

	/**
	 * Sets the style for this particular widget.
	 * Will only affect children if a subclass decides to do so (ie,
	 * the style demands a child has another style).
	 */
	virtual void styleChanged();

	/**
	 * Processes user-keyboard-input.
	 * The character is simply appended to the text.
	 *
	 * TODO: Make more sophisticated.
	 */
	virtual void processInput(QChar c);
};
///////////////////////////////////////////////////////////////////////////////////////////////

DEFINE_LOOSE_PTR(LineEdit);
